Skip to content

improve multi mock behavior#553

Closed
mck1117 wants to merge 2 commits into
microsoft:masterfrom
mck1117:mock-queue
Closed

improve multi mock behavior#553
mck1117 wants to merge 2 commits into
microsoft:masterfrom
mck1117:mock-queue

Conversation

@mck1117
Copy link
Copy Markdown

@mck1117 mck1117 commented Nov 6, 2020

This PR updates the mocking behavior to match what's advertised by the doc header above HCMockAddMock:

/// You can set multiple active mock responses by calling HCMockAddMock() multiple 
/// times with a set of mock responses. If the HTTP call matches against a set mock responses, 
/// they will be executed in order for each subsequent call to HCHttpCallPerformAsync(). When the 
/// last matching mock response is hit, the last matching mock response will be repeated on 
/// each subsequent call to HCHttpCallPerformAsync().

Previously, the last-set mock for a particular URL was the only one that would ever return. Now the behavior matches the comment: Each matching mock is used and consumed in order they were created, with the last mock repeated forever.

@ghost
Copy link
Copy Markdown

ghost commented Nov 6, 2020

CLA assistant check
All CLA requirements met.

@jasonsandlin
Copy link
Copy Markdown
Member

if you want this in, please sign CLA or ping me offline if you work at Microsoft. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants